-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add description of the return status for vaSyncSurface() #774
base: master
Are you sure you want to change the base?
Add description of the return status for vaSyncSurface() #774
Conversation
79c3709
to
8ba1827
Compare
8ba1827
to
36407ae
Compare
8b94cd0
to
35d5b95
Compare
Hi, @XinfengZhang @Jexu, have add more detail description, could you pls help to review this PR again? |
va/va.h
Outdated
* and verify its validity and integrity. | ||
* - \ref VA_STATUS_ERROR_OPERATION_FAILED: When the attempt to retrieve the status report fails or related work | ||
* on the current surface fails, this error is generated. In such cases, the client can proceed with subsequent | ||
* frames by ignore the error, but it may involve incorrect result like corruption. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it means "operation failed" could be ignored by application
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VA_STATUS_ERROR_OPERATION_FAILED is caused by status report fail which cannot be used to determine whether the result is correct. So declare here that APP can ignore this error but may meet incorrect result.
And will add more detail like "To init new context to avoid protentional incorrect result."
va/va.h
Outdated
* on the current surface fails, this error is generated. In such cases, the client can proceed with subsequent | ||
* frames by ignore the error, but it may involve incorrect result like corruption. | ||
* - \ref VA_STATUS_ERROR_HW_BUSY: This error indicates that synchronization is still in progress or GPU hang happens. | ||
* The client could call the function again within a period of time to wait hw execution completion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same surfaceID again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will add it
va/va.h
Outdated
* - \ref VA_STATUS_ERROR_HW_BUSY: This error indicates that synchronization is still in progress or GPU hang happens. | ||
* The client could call the function again within a period of time to wait hw execution completion. | ||
* If hw execution could not complete successfully, gpu hang and reset may occur, in this case, | ||
* application could try to recover media context by initialing new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must recreate context? could application just ignore it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the recreate context is must, VA_STATUS_ERROR_HW_BUSY indicate that HW reset happened, this need to recover media context. Media reset will not return this error.
va/va.h
Outdated
* - \ref VA_STATUS_ERROR_DECODING_ERROR: This error is encountered when macroblock (MB) errors with | ||
* non-conformance input clips are detected during the decoding process. The application can proceed with | ||
* subsequent frames, but it is advised to be aware of potential corruption in the output. | ||
* Call vaQuerySurfaceError could get more details of mb error information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
difference comparing with VA_STATUS_ERROR_OPERATION_FAILED
I agree with the direction, provide hint to application , then application could handle correlated errors , ignore , or reset the context etc. . but operation failed is unclear. |
@XinfengZhang Thanks for the comments. and I will refine this PR for below two point:
The VA_STATUS_ERROR_HW_BUSY is only for HW reset, so cannot ignore this error, vaSyncSurface will return success if media reset happended.
can see the below comment: #774 (comment) |
va/va.h
Outdated
* - \ref VA_STATUS_ERROR_OPERATION_FAILED: When the attempt to retrieve the status report fails or related work | ||
* on the current surface fails, this error is generated. In such cases, the client can proceed with subsequent | ||
* frames by ignore the error, but it may involve incorrect result like corruption, MD5 mismatch or HW hang. | ||
* Initialize new context can avoid the potential issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Initialize new context can avoid the potential issues. | |
* Initializing new context can avoid the potential issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, fixed
va/va.h
Outdated
* - \ref VA_STATUS_ERROR_HW_BUSY: This error indicates that synchronization is still in progress or GPU hang happens. | ||
* The client could call the function again with the same render_target within a period of time to wait hw execution completion. | ||
* If hw execution could not complete successfully, gpu hang and reset may occur, in this case, | ||
* application could try to recover media context by initialing new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* application could try to recover media context by initialing new one. | |
* application could try to recover media context by initializing new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, fixed
va/va.h
Outdated
* - \ref VA_STATUS_ERROR_DECODING_ERROR: This error is encountered when macroblock (MB) errors with | ||
* non-conformance input clips are detected during the decoding process. The application can proceed with | ||
* subsequent frames, but it is advised to be aware of potential corruption in the output. | ||
* Call vaQuerySurfaceError could get more details of mb error information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Call vaQuerySurfaceError could get more details of mb error information. | |
* Call vaQuerySurfaceError to get more details on mb error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, fixed
va/va.h
Outdated
@@ -4187,6 +4187,26 @@ Synchronization | |||
* This function blocks until all pending operations on the render target | |||
* have been completed. Upon return it is safe to use the render target for a | |||
* different picture. | |||
* | |||
* Possible errors: | |||
* - \ref VA_STATUS_ERROR_INVALID_CONTEXT: This error occurs when the function is provided with an invalid context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error occurs when the function is provided with an invalid context.
Function prototype does not have context at all. So, this error is inadequate ( VA_STATUS_ERROR_INVALID_DISPLAY
seems more reasonable) or at least incorrectly described. VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this advice, the media-driver will return VA_STATUS_ERROR_INVALID_CONTEXT
instead of VA_STATUS_ERROR_INVALID_DISPLAY
, so I only correct the comments here to make sure the API compatible with the old version.
Also, please, squash commits. For this change there should be just 1 commit in the PR. |
this will indicate APP behavior when meet VA_STATUS_ERROR_DECODING_ERROR from vaSyncSurface Signed-off-by: Pengxin Yuan <[email protected]>
3a201cd
to
b0a8b63
Compare
@dvrogozh Thanks for your review, and have refined this PR, could pls have a look again? |
Hi, @dvrogozh @XinfengZhang , Can you take another look at this PR if you have time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Hi, @XinfengZhang , Could you pls take another look at this PR when you have time? |
this will indicate APP behavior when meet VA_STATUS_ERROR_DECODING_ERROR from vaSyncSurface